﻿//------------------------------------------------------------------------------
// <copyright file="ClassDefinition.cs" company="CommerceServer.net, Inc">
//    (c) 2012 CommerceServer.net, Inc. and its affiliates. All rights reserved.
// </copyright>
// <summary></summary>
//------------------------------------------------------------------------------ 
namespace CommerceServerContrib.CodeGeneration
{
    using CommerceServer.Foundation.Definitions;
    using System;
    using System.Collections.Generic;

    public class ClassDefinition : MarshalByRefObject
    {
        public ClassDefinition(string name, CommerceServerArea? area)
        {
            this.Name = name;

            if (area != null && area.HasValue)
            {
                this.Name += area.Value.ToString();
            }

            this.Properties = new List<SimplifiedPropertyDefinition>();
            this.Relationships = new List<SimplifiedRelationshipDefinition>();

            if (area == null || !area.HasValue)
            {
                this.Area = area.ToString();
            }
        }
        
        public string Name { get; set; }

        public string Area { get; set; }

        public string WeaklyTypedName { get; set; }

        public List<SimplifiedPropertyDefinition> Properties { get; private set; }

        public List<SimplifiedRelationshipDefinition> Relationships { get; private set; }
    }
}
